** Replication files for "Ministerial Autonomy, Paliamentary Scrutiny and Government reform Output in Parliamentary Democracies
** Authors: Hanna Bäck, Wolfgang C. Müller, Mariyana Angelova, Daniel Strobl
** This file replicates rebusness analyses reported in the Appendix:  table E1, table E2, table E3, table E4, table E5, table E6				
** To create figure E1 from the Appendix use stata do file "file1_main_analyses.do"

** Corresponding author: Mariyana Angelova - angelova@ceu.edu
** 15.01.2021 Vienna




clear all
set more off
cd "~/Desktop/Replication files"
use "./data.dta", clear



*** keep cases without nas in the alternation variables 
 drop if alt_rm_cp4y==. 
  	gen zero = 0
	gen zero10 = 9.5
	gen zero5 = 5
							
	**---------------------------------------------------
	** 
	** Analyses reported in Table E1 in the Appendix
	**
	** Hierarchical Models
	**---------------------------------------------------
	
	**=================================================================================================================================================
	** model A1: Multilevel Mixed-Effects Negative Binomial Model of the Number of Social and Economic Government Reform Measures in Coalition Governments 
	**=================================================================================================================================================
	
		menbreg  nreforms  c.alt_rm_cp4y##c.mv_index_value  c.alt_swsw_coalition_cp4y##c.mv_index_value n_cab_parties c.rm_distance_swswCoailtion cab_av_realgdpgrChange  cab_av_unemp_crisis_d cab_av_inflationChange c.cab_duration_y i.policy_f || country_f:, irr
		est sto E1
		
		** export table E1 from the Appendix
		esttab E1 using APPENDIX_table_E1.rtf, label se b(2) scalar(ll aic) sfmt(0) nomtitles replace eform star(~ .1 * .05 ** .01 *** 0.001)

	***=========================================================
	** MULTICOLINEARITY DIAGNOSTICS
	***=========================================================
	
	gen alt_rm_INT_mv_index = alt_rm_cp4y*mv_index_value
	gen alt_sw_com_INT_mv_index = alt_swsw_coalition_cp4y*mv_index_value

	*-----------------------------------------------------------
	* Table E2: Correlation Matrix
	*-----------------------------------------------------------	
	
	corr  nreforms  alt_rm_cp4y alt_swsw_coalition_cp4y mv_index_value rm_distance_swswCoailtion n_cab_parties cab_av_realgdpgrChange cab_av_unemp_crisis_d cab_av_inflationChange cab_duration_y policy_f alt_rm_INT_mv_index alt_sw_com_INT_mv_index
	estpost corr  nreforms  alt_rm_cp4y alt_swsw_coalition_cp4y mv_index_value rm_distance_swswCoailtion n_cab_parties cab_av_realgdpgrChange cab_av_unemp_crisis_d cab_av_inflationChange cab_duration_y policy_f alt_rm_INT_mv_index alt_sw_com_INT_mv_index, matrix listwise
	est store correlation
	esttab correlation using APPENDIX_table_E2.rtf, unstack not noobs compress replace  b(%5.2f)


	***=========================================================
	* Collinearity checks
	***=========================================================
	** Note: collin requires only the IV, do not include the DV
	
	
	*-----------------------------------------------------------
	* Table E3: Collinearity Diagnostics for Model A1 from Table E1
	*-----------------------------------------------------------	
	
	** variables as they are
	 collin  alt_rm_cp4y  alt_swsw_coalition_cp4y mv_index_value rm_distance_swswCoailtion  n_cab_parties  cab_av_realgdpgrChange  cab_av_unemp_crisis_d cab_av_inflationChange cab_duration_y policy_f alt_rm_INT_mv_index alt_sw_com_INT_mv_index if !missing(nreforms)
	** centered data
	*collin  alt_rm_cp4y  alt_swsw_coalition_cp4y mv_index_value rm_distance_swswCoailtion  n_cab_parties  cab_av_realgdpgrChange  cab_av_unemp_crisis_d cab_av_inflationChange cab_duration_y policy_f alt_rm_INT_mv_index alt_sw_com_INT_mv_index if !missing(nreforms), corr 


	*-----------------------------------------------------------
	* Table E4: Collinearity Diagnostics for Model 2 (Table 2) 
	*-----------------------------------------------------------	
	* collinearity for model 2
	collin  alt_rm_cp4y  alt_swsw_coalition_cp4y mv_index_value alt_rm_INT_mv_index rm_distance_swswCoailtion  n_cab_parties  cab_av_realgdpgrChange  cab_av_unemp_crisis_d cab_av_inflationChange cab_duration_y policy_f  if !missing(nreforms)
	
	*-----------------------------------------------------------
	* Table E5: Collinearity Diagnostics for Model 3 (Table 2)
	*-----------------------------------------------------------	
	* collinearity for model 3 
	 collin  alt_rm_cp4y  alt_swsw_coalition_cp4y mv_index_value alt_sw_com_INT_mv_index rm_distance_swswCoailtion  n_cab_parties  cab_av_realgdpgrChange  cab_av_unemp_crisis_d cab_av_inflationChange cab_duration_y policy_f   if !missing(nreforms)

	

	**=========================================================	
	**---------------------------------------------------------
	** 					
	**					FIXED EFFECTS Models
	** 
	** 			Country and policy area fixed effects
	**
	** 			Standard errors clustered by country
	**
	**=========================================================

	
	**=========================================================
	** Model FE1
	**=========================================================
		nbreg  nreforms c.alt_rm_cp4y c.alt_swsw_coalition_cp4y n_cab_parties c.rm_distance_swswCoailtion cab_av_realgdpgrChange  cab_av_unemp_crisis_d cab_av_inflationChange c.cab_duration_y  i.policy_f i.country_f ,  cluster(country_f) irr level(90)
		est sto fe1
		
	**=========================================================
	** Model FE2
	**=========================================================

		nbreg  nreforms   c.alt_rm_cp4y##c.mv_index_value  c.alt_swsw_coalition_cp4y c.rm_distance_swswCoailtion  n_cab_parties  cab_av_realgdpgrChange  cab_av_unemp_crisis_d cab_av_inflationChange c.cab_duration_y i.policy_f i.country_f, cluster(country_f) irr 
		est sto fe2
		
	**=========================================================
	** Model FE3
	**=========================================================	
	* cluster(country_f)
		nbreg  nreforms  c.alt_rm_cp4y  c.alt_swsw_coalition_cp4y##c.mv_index_value  c.rm_distance_swswCoailtion  n_cab_parties cab_av_realgdpgrChange  cab_av_unemp_crisis_d cab_av_inflationChange c.cab_duration_y i.policy_f i.country_f,  cluster(country_f) irr
		est sto fe3
		
	**=========================================================
	** Model FE4
	**=========================================================	
		nbreg  nreforms  c.alt_rm_cp4y##c.mv_index_value  c.alt_swsw_coalition_cp4y##c.mv_index_value c.rm_distance_swswCoailtion  n_cab_parties cab_av_realgdpgrChange  cab_av_unemp_crisis_d cab_av_inflationChange c.cab_duration_y i.policy_f i.country_f,  cluster(country_f) irr
		est sto fe4
	
	**=========================================================
	* Export table E6
	**=========================================================

	esttab fe1 fe2 fe3 fe4 using APPENDIX_table_E6.rtf, label se b(2) scalar(ll aic) sfmt(0) nomtitles replace eform star(~ .1 * .05 ** .01 *** 0.001)
		
	**================================================================================================================================================================================================================
	** Plot figure E1 "Expected Number of Government Social and Economic Policy Reform Measures for Different Levels of Responsible Minister Alternation and Legislative"
	** To plot figure E1 please use the stata do file "file1_main_analyses.do"
	**================================================================================================================================================================================================================	


	**================================================================================================================================================================================================================
	** Note
	** Figure E2 "Legislative Policing Strength Index – Cabinet Average Values" is based on the legislative policing index generously provided by Lanny Martin and George Vanberg, used in Martin and Vanberg (2020). Replication files for figure E2 are available upon request from the authors.
	** Results from intercoder reliability analyses are available upon request from the authors.
	**================================================================================================================================================================================================================
		
		
		
